const temp1:undefined = undefined;
const temp2: null = null;

// 仅仅在关闭了 strictNullChecks 选项的情况下才能将 null 和 undefined 赋值给任意类型
// const temp3: string = null;
// const temp4: number = undefined;

// let temp5: string = null;
let temp6 = null;

function getStr(): string { 
  if(Math.random() > 0.5) {
    return 'hello';
  }
}

type User = {
  name: string
  age: number
}

function getUser(): User {
  if(Math.random() > 0.5) {
    return { name: 'lily', age: 18 };
  }
}